package com.wanghengzhi.design.patterns.command;

class CommandMain {

    /**
     * 命令模式： 请求以命令的形式传递给调用者，由调用者执行。
     */
    public static void main(String[] args) {
        Broker broker = new Broker();

        broker.takeOrder(new SellStock(new Stock()));
        broker.takeOrder(new SellStock(new Stock()));
        broker.takeOrder(new SellStock(new Stock()));
        broker.takeOrder(new BuyStock(new Stock()));
        broker.takeOrder(new BuyStock(new Stock()));
        broker.takeOrder(new BuyStock(new Stock()));

        broker.placeOrders();
    }
}
